package com.iapplize.gcm.test;

import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class MyApplication extends Application{
	
	public Activity mActivity;
	
	@Override
	public void onCreate() {
		
		
		
	}
	
	public void setMainActivety(Activity mainActivety) {
		this.mActivity = mainActivety;

	}
	
	public Boolean checkConnecion() {

		ConnectivityManager cm = (ConnectivityManager) this
				.getSystemService(Context.CONNECTIVITY_SERVICE);
		NetworkInfo netInfo = cm.getActiveNetworkInfo();
		if (netInfo != null && netInfo.isConnectedOrConnecting()
				&& cm.getActiveNetworkInfo().isAvailable()
				&& cm.getActiveNetworkInfo().isConnected()) {

			return true;

		}
		return false;
	}
}
